<?php
include("database.php");
$sql = "SELECT * FROM main2  ORDER BY `px` ASC";
$res=$conn->query($sql);
$data=$res->fetch_all();
echo json_encode($data);
$conn->close();
?>
